<?php if (!defined('THINK_PATH')) exit();?>


<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>你办囍事 我送囍酒</title>
        
		<meta name="viewport" content="width=640,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HTTP_HOST_URL');?>/Public/game/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HTTP_HOST_URL');?>/Public/game/css/awardMap.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HTTP_HOST_URL');?>/Public/game/css/tool.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HTTP_HOST_URL');?>/Public/game/css/animate.css" />
	</head>
	<body>
		<?php
 $jssdk = new \JSSDK("wxfd8742a962585bcd", "1390437b5921430a49b529c4a79aba62"); $signPackage = $jssdk->GetSignPackage(); ?>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId:  '<?php echo $signPackage["appId"];?>', // 必填，公众号的唯一标识
        timestamp:<?php echo $signPackage["timestamp"];?>, // 必填，生成签名的时间戳
        nonceStr: '<?php echo $signPackage["nonceStr"];?>', // 必填，生成签名的随机串
        signature: '<?php echo $signPackage["signature"];?>',// 必填，签名，见附录1
        jsApiList: [
            'onMenuShareTimeline',
            'onMenuShareAppMessage'
        ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });

    wx.ready(function () {
        initShareTimeline();
        initShareAppMessage();
//      music.play();
    });


/**
 * 初始化分享到朋友圈的设置
 */
function initShareTimeline(title,link,imgUrl){
	title= title?title:"<?php echo $BanquetUserInfo['name'];?>要结婚了，快来Ta的婚宴抢个座！";
	link= link?link:"<?php echo \Org\Net\Fun::url('home/page/table',array('id'=>$BanquetInfo['id'])); ?>";
	imgUrl = imgUrl?imgUrl:"<?php echo C('HTTP_HOST_URL');?>/Public/images/share.png";
    //分享到朋友圈
    wx.onMenuShareTimeline({
        title: title, // 分享标题
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
        trigger: function(res) {
		// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
		//              alert('用户点击分享到朋友圈');
            
		},
		success: function(res) {
            <?php if($BanquetUserInfo['wx_id']==$userInfo['wx_id']):?>
            if(showwel){
            		try{
            			if (typeof(eval("showwel")) == "function") {
			           showwel(3);
			        }
            		}catch(e){
            			
            		}
            }
            
            <?php endif;?>
//			sharelog();
			///////////////////////////////////////////////
//			close_mask();
            
            
		},
		cancel: function(res) {
		},
		fail: function(res) {
		}
    });
}


/**
 * 初始化分享好友的设置
 */
function initShareAppMessage(title,desc,link,imgUrl){ 
	
	title= title?title:"<?php echo $BanquetUserInfo['name'];?>要结婚了，快来Ta的婚宴抢个座！";
	desc=desc?desc:"你办囍事，我送囍酒";
	link= link?link:"<?php echo \Org\Net\Fun::url('home/page/table',array('id'=>$BanquetInfo['id'])); ?>";
	imgUrl = imgUrl?imgUrl:"<?php echo C('HTTP_HOST_URL');?>/Public/images/share.png";
	//分享给朋友
    wx.onMenuShareAppMessage({
        title: title, // 分享标题
        desc: desc, // 分享描述
        link: link, // 分享链接
        imgUrl: imgUrl, // 分享图标
		trigger: function(res) {
            
			// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
			//          alert('用户点击发送给朋友');
		},
		success: function(res) {
            <?php if($BanquetUserInfo['wx_id']==$userInfo['wx_id']):?>
             
        		try{
        			if (typeof(eval("showwel")) == "function") {
		           showwel(3);
		        }
        		}catch(e){
        			
        		}
            <?php endif;?>
//			sharelog();
			///////////////////////////////////////////////////////
//			close_mask();
            
		},
		cancel: function(res) {
		},
		fail: function(res) {
		}
    });
}
    
//提交分享记录    
function sharelog(){
	MYajax({"type":"share"},"/index.php/Home/app/share.html",function(res){})
}


//秘钥
var tokenkey = "lkasdj213489ulkjadsf";
function MYajax(requestData,url,successCallback){
	var requestData = requestData;
	var url = url;
	requestData = JSON.stringify(requestData);
	var requestKey = $.md5(requestData+tokenkey);
	$.ajax({
		type:"post",
		url:url,
		data:{'data':requestData,"key":requestKey},
		async:true,
		success:function(res){
			successCallback(res);
		},
		dataType:'json',
		fail:function(e){
			
		}
	});
}
</script>
		<div class="web">
			<div class="content">
				<!--城市的切换键部分-->
			<button class="switching_point" id="gd_button"><img src="/Public/game/images/switching_point_gd.png" /></button>
			<button class="switching_point" id="hn_button"><img src="/Public/game/images/switching_point_hn.png" /></button>
			<!--地图部分-->
			<div class="map_wrap">
				<!--广东省部分-->
				<div class="gd_map" id="gd_map">
					<img src="/Public/game/images/map_gd.png" class="guangdong_map" />
					<div class="map_city">
						<div class="city_icon gd_city_icon1  animated fadeInDownBig delay_100 active">
							<div class="city_text">
								<span>茂名</span><br />
								<i><?php echo ($countArr["Mm"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon2 animated fadeInDownBig delay_200">
							<div class="city_text">
								<span>阳江</span><br />
								<i><?php echo ($countArr["Yj"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon3 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>韶关</span><br />
								<i><?php echo ($countArr["Sg"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon4 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>广州</span><br />
								<i><?php echo ($countArr["Gz"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon23 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>湛江</span><br />
								<i><?php echo ($countArr["Zj"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon6 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>河源</span><br />
								<i><?php echo ($countArr["Hy"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon7 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>中山</span><br />
								<i><?php echo ($countArr["Zs"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon8 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>清远</span><br />
								<i><?php echo ($countArr["Qy"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon9 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>珠海</span><br />
								<i><?php echo ($countArr["Zh"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon10 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>佛山</span><br />
								<i><?php echo ($countArr["Fs"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon11 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>肇庆</span><br />
								<i><?php echo ($countArr["Zq"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon12 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>江门</span><br />
								<i><?php echo ($countArr["Jm"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon13 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>惠州</span><br />
								<i><?php echo ($countArr["Hz"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon14 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>揭阳</span><br />
								<i><?php echo ($countArr["Jy"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon15 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>汕尾</span><br />
								<i><?php echo ($countArr["Sw"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon16 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>梅州</span><br />
								<i><?php echo ($countArr["Mz"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon17 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>潮州</span><br />
								<i><?php echo ($countArr["Cz"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon18 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>深圳</span><br />
								<i><?php echo ($countArr["Sz"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon19 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>东莞</span><br />
								<i><?php echo ($countArr["Dg"]); ?></i>
								<span>份</span>
							</div>
						</div>
						<div class="city_icon gd_city_icon22 animated fadeInDownBig delay_300">
							<div class="city_text">
								<span>汕头</span><br />
								<i><?php echo ($countArr["St"]); ?></i>
								<span>份</span>
							</div>
						</div>
					</div>
				</div>
				<!--海南省部分-->
				<div class="hn_map" id="hn_map">
					<img src="/Public/game/images/map_hn.png" class="hainan_map" />
					<div class="map_city">
						<div class="city_icon hn_city_icon1 animated  delay_00">
							<div class="city_text">
								<span>三亚</span><br />
								<i><?php echo ($countArr["Sy"]); ?></i><span>份</span>
							</div>
						</div>
						<div class="city_icon hn_city_icon2 animated  delay_200">
							<div class="city_text">
								<span>海口</span><br />
								<i><?php echo ($countArr["Hk"]); ?></i><span>份</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--套装待领取部分-->
			<div class="surplus_number">
				<h3>剩余<span><?php echo ($effective); ?></span>套</h3><br />
				<h1>婚宴定制囍酒套装</h1><br />
				<h3>待领取</h3>
			</div>
			<!--领取规则部分-->
			<div class="rule">
					<h2>领取方式：</h2>
					<p>符合领取条件的用户凭结婚证以及酒店婚宴预订单据，前往张裕白兰地线下兑换点（限广东省、海南省区域）可获赠婚宴定制囍酒套装一份，共9999份，数量有限，领完为止。</p>
					<h2>领取时间：</h2>
					<p>2016年9月9日—2017年1月9日</p>
					<h2>领取条件：</h2>
					<!--0923修改时间为"2017年1月9日"-->
					<p>于2016年1月1日后进行婚姻登记，并在2016年9月9日—2017年1月9日举办婚宴的新人（限广东省、海南省区域）。</p>
				</div>
			</div>
			<div class="footer">
				<!--跳转按钮部分-->
				<div class="button F_T animated bounceInUp">
			<a href="<?php echo \Org\Net\Fun::url('home/page/searchStores'); ?>" class="jump_button">找到离我最近的领取点</a>
			</div>
			<!--返回首页部分-->
			<a href="<?php echo \Org\Net\Fun::url('home/page/index'); ?>" class="get_back"><img src="/Public/game/images/get_back.png"/></a>
			</div>
			
		</div>
		<script src="<?php echo C('HTTP_HOST_URL');?>/Public/game/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="<?php echo C('HTTP_HOST_URL');?>/Public/game/js/awardMap.js" type="text/javascript" charset="utf-8"></script>
		<script src="<?php echo C('HTTP_HOST_URL');?>/Public/game/js/jquery.transit.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(".city_icon").on("click",function(){
				//location.href = "Redeem.html";
				location.href = "<?php echo \Org\Net\Fun::url('home/page/Redeem'); ?>";
			})
			/************数量闪出**********************/
			var target = <?php echo ($effective); ?>; //目标的数量
			var i = 10000; //总数
			var clock = setInterval(function() {
				i -= 50;
				if(i <= target) {
					i = target;
					clearInterval(clock);
				}
				$(".surplus_number h3 span").text(i);
			}, 16)
		</script>
	</body>
</html>